﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using System.Web.Http.Dispatcher;
using System.Reflection;

namespace Circle.Web
{
    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {


            config.Routes.MapHttpRoute(
              name: "UserActionApi",
              routeTemplate: "api/user/{action}/{pageIndex}",
              defaults: new { controller = "User", pageIndex = RouteParameter.Optional }
            );

            config.Routes.MapHttpRoute(
                name: "ActionApi",
                routeTemplate: "api/{controller}/{action}/{key}/{pageIndex}",
                defaults: new { key = RouteParameter.Optional, pageIndex = RouteParameter.Optional }
            );

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{key}",
                defaults: new { key = RouteParameter.Optional }
            );

           
        }
    }
}
